public class ArrayExercise02 {
    public static void main(String[] args) {
        int[] arrayCompair = {50, 4, -1, 30, 10, 23};
        int max = 0;
        int maxIndex = 0;
        for (int i = 0; i < arrayCompair.length; i++) {
            if (arrayCompair[i] > max) {
                max = arrayCompair[i];
                maxIndex = i;
            }
        }
        System.out.println("最大值是：" + max + "，下标为：" + maxIndex);
    }
}
